import Vue from 'vue'
//1. 导入路由
import VueRouter from 'vue-router'
//2. 安装路由
Vue.use(VueRouter)

//导入时间插件
import moment from "moment"
//定义全局的过滤器
Vue.filter('dateFormat',function(dataStr,pattern="YYYY-MM-DD HH:mm:ss"){
 return moment(dataStr).format(pattern)
})
//导入rescource
import VueResource from 'vue-resource'
Vue.use(VueResource)
Vue.http.options.root="http://localhost:3006/"
Vue.http.options.emulateJson = true

//按需导入mint-ui
import {Header,Button} from 'mint-ui'
Vue.component(Header.name,Header)
Vue.component(Button.name,Button)
//导入mint ui
import MintUI from "mint-ui"
Vue.use(MintUI)

//轮播图
import { Swipe, SwipeItem } from 'mint-ui'; 
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem)
//懒加载
import {Lazyload} from "mint-ui"
Vue.use(Lazyload)
//图片缩略图预览组件
  //引入veu-preview
  import VuePreview from 'vue-preview'
  //使用vue-preview
  Vue.use(VuePreview)

//3. 导入自己的router.js路由模块
import router from './router.js'
import app from './app.vue'

//导入样式
import 'mint-ui/lib/style.min.css'
import './libs/mui/css/mui.min.css'
import './libs/mui/css/icons-extra.css'
var vm = new Vue({
    render:h=>h(app),
    router
}).$mount('#app')